package com.ruoyi.project.app.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.app.mapper.AppCustomerMapper;
import com.ruoyi.project.app.domain.AppCustomer;
import com.ruoyi.project.app.service.IAppCustomerService;

/**
 * 用户Service业务层处理
 * 
 * @author hry
 * @date 2020-10-15
 */
@Service
public class AppCustomerServiceImpl extends ServiceImpl<AppCustomerMapper, AppCustomer> implements IAppCustomerService
{
    @Autowired
    private AppCustomerMapper appCustomerMapper;

    /**
     * 查询用户
     * 
     * @param id 用户ID
     * @return 用户
     */
    @Override
    public AppCustomer selectAppCustomerById(Long id)
    {
        return appCustomerMapper.selectAppCustomerById(id);
    }

    /**
     * 查询用户列表
     * 
     * @param appCustomer 用户
     * @return 用户
     */
    @Override
    public List<AppCustomer> selectAppCustomerList(AppCustomer appCustomer)
    {
        return appCustomerMapper.selectAppCustomerList(appCustomer);
    }

    /**
     * 新增用户
     * 
     * @param appCustomer 用户
     * @return 结果
     */
    @Override
    public int insertAppCustomer(AppCustomer appCustomer)
    {
        appCustomer.setCreateTime(DateUtils.getNowDate());
        return appCustomerMapper.insertAppCustomer(appCustomer);
    }

    /**
     * 修改用户
     * 
     * @param appCustomer 用户
     * @return 结果
     */
    @Override
    public int updateAppCustomer(AppCustomer appCustomer)
    {
        appCustomer.setUpdateTime(DateUtils.getNowDate());
        return appCustomerMapper.updateAppCustomer(appCustomer);
    }

    /**
     * 批量删除用户
     * 
     * @param ids 需要删除的用户ID
     * @return 结果
     */
    @Override
    public int deleteAppCustomerByIds(Long[] ids)
    {
        return appCustomerMapper.deleteAppCustomerByIds(ids);
    }

    /**
     * 删除用户信息
     * 
     * @param id 用户ID
     * @return 结果
     */
    @Override
    public int deleteAppCustomerById(Long id)
    {
        return appCustomerMapper.deleteAppCustomerById(id);
    }
}
